package com.study.bob.adapter;

/**
 * Created by bob on 2016/5/8.
 */
public class AdapterPatternTest {

    public static void main(String args[]){
        testClassAdapter();
        testObjectAdapter();

    }

    public static void testClassAdapter(){
        SocketAdapter socketAdapter =  new SocketClassAdapterImpl();
        System.out.println("class adapter is get3Volt:"+socketAdapter.get3Volt().getVolts());
        System.out.println("class adapter is get30Volt:"+socketAdapter.get30Volt().getVolts());
        System.out.println("class adapter is get120Volt:"+socketAdapter.get120Volt().getVolts());
    }

    public static void testObjectAdapter(){
        SocketAdapter socketAdapter = new SocketObjectAdapterImpl();
        System.out.println("object adapter is get3Volt:"+socketAdapter.get3Volt().getVolts());
        System.out.println("object adapter is get30Volt:"+socketAdapter.get30Volt().getVolts());
        System.out.println("object adapter is get120Volt:"+socketAdapter.get120Volt().getVolts());

    }
}
